class Cat:
    def eat(self):
        print(f"小猫{self.name},{self.age}岁啦,爱吃鱼")
    def drink(self):
        print(f"小猫{tom.name}爱喝水")
    def __init__(self,name,age):
        self.name = name
        self.age = age
    def __str__(self):
        return f"姓名：{self.name},年龄：{self.age}"
# 创建对象
tom = Cat("tom",20)
print(tom)
print(dir(tom))
# 添加属性
# tom.name = "tom"
# tom.age = 2
print(tom.name)
tom.eat()
tom.drink()